package com.woniuxy.educationplatform.mapper;

import com.woniuxy.educationplatform.bean.RefundBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RefundMapper {
    /**
     * 新增退款信息
     * @param refundBean
     * @return
     */
    @Insert("insert into refund_info (create_time,reason,status,order_id)" +
            "values (now(),#{r.reason},#{r.status},#{r.orderId})")
    int add(@Param("r") RefundBean refundBean);


    @Select("select id,create_time as createTime,reason,status from refund_info where order_id = #{id}")
    RefundBean findByOrderId(Long id);
}
